package com.kuang.test;

import com.kuang.pojo.Books;
import com.kuang.service.BookService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.web.context.support.XmlWebApplicationContext;

/**
 * @author Niddles
 * @create 2021：05:23:13:42
 * @Theme default
 */
public class test {
    @Test
    public void testservice(){
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        BookService bookServiceImpl = (BookService) applicationContext.getBean("bookService");
        for (Books books : bookServiceImpl.queryBooks()) {
            System.out.println(books);
        }

    }
}
